#ifndef Q3DS_PROCESS_H
#define Q3DS_PROCESS_H

#include <lib3ds/mesh.h>

#include <QString>
#include <QMatrix4x4>

class Lib3dsFile;
class Lib3dsLight;
class Lib3dsNode;

struct Q3dsMesh;

class Q3dsProcess
{
public:
    Q3dsProcess(const QString &path, double _a = 0., double _alpha = 0.,
                double _d = 0., double _theta = 0.);

    /// 加载 3ds 文件
    void loadModel();

    /// 获取场景信息
    Q3dsMesh *getMesh(float angle, QMatrix4x4 &translation_matrix);

private:
    /// 提取 3ds 中有用的信息
    void setting();
    void renderNode(Lib3dsNode *node);

private:
    QString file_path_;
    Lib3dsFile *file_{ nullptr };

    // dh 参数
    double a;
    double alpha;
    double d;
    double theta;

    int anti_alias_;

    Q3dsMesh *mesh_{ nullptr };
};

#endif // Q3DS_PROCESS_H
